package com.ruoyi.system.service;

import java.util.HashMap;
import java.util.List;
import java.util.Map;

import com.ruoyi.system.domain.HospitalSubscribeOrder;
import com.ruoyi.system.domain.dto.HospitalSubscribeCreateOrderDto;
import com.ruoyi.system.domain.vo.HospitalSubscribeOrderVo;
import com.ruoyi.system.domain.vo.WeChatPayVo;

import javax.servlet.http.HttpServletRequest;

/**
 * 订单Service接口
 * 
 * @author ruoyi
 * @date 2025-04-30
 */
public interface IHospitalSubscribeOrderService 
{
    /**
     * 查询订单
     * 
     * @param id 订单主键
     * @return 订单
     */
    public HospitalSubscribeOrder selectHospitalSubscribeOrderById(Long id);

    /**
     * 查询订单列表
     * 
     * @param hospitalSubscribeOrder 订单
     * @return 订单集合
     */
    public List<HospitalSubscribeOrder> selectHospitalSubscribeOrderList(HospitalSubscribeOrder hospitalSubscribeOrder);

    /**
     * 新增订单
     * 
     * @param hospitalSubscribeOrder 订单
     * @return 结果
     */
    public int insertHospitalSubscribeOrder(HospitalSubscribeOrder hospitalSubscribeOrder);

    /**
     * 修改订单
     * 
     * @param hospitalSubscribeOrder 订单
     * @return 结果
     */
    public int updateHospitalSubscribeOrder(HospitalSubscribeOrder hospitalSubscribeOrder);

    /**
     * 批量删除订单
     * 
     * @param ids 需要删除的订单主键集合
     * @return 结果
     */
    public int deleteHospitalSubscribeOrderByIds(Long[] ids);

    /**
     * 删除订单信息
     * 
     * @param id 订单主键
     * @return 结果
     */
    public int deleteHospitalSubscribeOrderById(Long id);

    /**
     * 查询订单关联的所有信息
     * @param hospitalSubscribeOrder
     * @return
     */
    List<HospitalSubscribeOrderVo> getOrderAllInfo(HospitalSubscribeOrder hospitalSubscribeOrder);


    /**
     * 创建订单
     * @param dto
     * @return
     */
    Map<String, String> createOrder(HospitalSubscribeCreateOrderDto dto);

    /**
     * 根据订单号关闭订单
     * @param orderNo
     */
    void closeOrderByOrderNo(String orderNo);

    /**
     * 关闭超时订单
     */
    void closeOrderList();

    /**
     * 订单支付
     * @param map
     * @return
     */
    WeChatPayVo orderPay(Map<String, String> map);

    /**
     * 根据订单预约体检时间
     * @param order
     * @return
     */
    boolean makeAnAppointment(HospitalSubscribeOrder order);

    /**
     * 根据订单号查询订单信息
     * @param orderNo
     * @return
     */
    HospitalSubscribeOrder getOrderInfoByOrderNo(String orderNo);

    /**
     * 支付成功回调
     * @param request
     * @return
     */
    HashMap<String,String> paySuccessCallback(HttpServletRequest request);

    /**
     * 根据订单修改预约体检时间
     * @param order
     * @return
     */
    boolean updateMakeAnAppointment(HospitalSubscribeOrder order);

    /**
     * 退款成功回调
     * @param request
     * @return
     */
    HashMap<String,String> refundSuccessCallback(HttpServletRequest request);

    /**
     * 完成订单
     * @param orderId
     * @return
     */
    boolean completeOrder(Long orderId);

    /**
     * 订单申请退款
     * @param orderId
     * @return
     */
    boolean refundOrder(Long orderId);

    /**
     * 已预约待上传结果
     */
    void completeOrderList();

    /**
     * 获取codeUrl
     * @param url
     * @return
     */
    String getCodeUrl(String url);
}
